package com.ruoyi.framework.web.domain.server;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.project.configureSystem.domain.SysArea;
import com.ruoyi.project.configureSystem.domain.SysNode;
import com.ruoyi.project.system.domain.SysMenu;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Treeselect树结构实体类
 *
 * @author ruoyi
 */
public class TreeSelectVO implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private String id;

    /** 节点名称 */
    private String label;

    private Integer isStation;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeSelectVO> children;

    public TreeSelectVO()
    {

    }

    public TreeSelectVO(SysNode sysNode)
    {
        this.id = sysNode.getNodeId();
        this.label = sysNode.getNodeName();
        this.isStation = sysNode.getIsStation();
        this.children = sysNode.getChildren().stream().map(TreeSelectVO::new).collect(Collectors.toList());
    }

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public List<TreeSelectVO> getChildren()
    {
        return children;
    }

    public void setChildren(List<TreeSelectVO> children)
    {
        this.children = children;
    }

    public Integer getIsStation() {
        return isStation;
    }

    public void setIsStation(Integer isStation) {
        this.isStation = isStation;
    }
}
